package com.ruoyi.project.modules.tableRelation.domain;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 外健关系对象 t_table_relation
 * 
 * @author smallrain
 * @date 2022-01-23
 */
public class TableRelation extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** ID */
    private Long id;

    /** 主表ID */
    @Excel(name = "主表ID")
    private Long masterTableId;

    /** 字段id */
    @Excel(name = "字段id")
    private Long masterFieldId;

    /** 主表关系类型（1-1 n-n） */
    @Excel(name = "主表关系类型", readConverterExp = "1=-1,n=-n")
    private String masterRelationType;

    /** 从表ID */
    @Excel(name = "从表ID")
    private Long slaveTableId;

    private String slaveTableName;

    /** 从表字段id */
    @Excel(name = "从表字段id")
    private Long slaveFieldId;

    private String slaveFieldName;

    public String getSlaveTableName() {
        return slaveTableName;
    }

    public void setSlaveTableName(String slaveTableName) {
        this.slaveTableName = slaveTableName;
    }

    public String getSlaveFieldName() {
        return slaveFieldName;
    }

    public void setSlaveFieldName(String slaveFieldName) {
        this.slaveFieldName = slaveFieldName;
    }

    /** 从表关系类型（1-1 n-n） */
    @Excel(name = "从表关系类型", readConverterExp = "1=-1,n=-n")
    private String slaveRelationType;

    public void setId(Long id)
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }
    public void setMasterTableId(Long masterTableId) 
    {
        this.masterTableId = masterTableId;
    }

    public Long getMasterTableId() 
    {
        return masterTableId;
    }
    public void setMasterFieldId(Long masterFieldId) 
    {
        this.masterFieldId = masterFieldId;
    }

    public Long getMasterFieldId() 
    {
        return masterFieldId;
    }
    public void setMasterRelationType(String masterRelationType) 
    {
        this.masterRelationType = masterRelationType;
    }

    public String getMasterRelationType() 
    {
        return masterRelationType;
    }
    public void setSlaveTableId(Long slaveTableId) 
    {
        this.slaveTableId = slaveTableId;
    }

    public Long getSlaveTableId() 
    {
        return slaveTableId;
    }
    public void setSlaveFieldId(Long slaveFieldId) 
    {
        this.slaveFieldId = slaveFieldId;
    }

    public Long getSlaveFieldId() 
    {
        return slaveFieldId;
    }
    public void setSlaveRelationType(String slaveRelationType) 
    {
        this.slaveRelationType = slaveRelationType;
    }

    public String getSlaveRelationType() 
    {
        return slaveRelationType;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("masterTableId", getMasterTableId())
            .append("masterFieldId", getMasterFieldId())
            .append("masterRelationType", getMasterRelationType())
            .append("slaveTableId", getSlaveTableId())
            .append("slaveFieldId", getSlaveFieldId())
            .append("slaveRelationType", getSlaveRelationType())
            .toString();
    }
}
